<template>
    <view class="index-class">
        <m-header @reload="layout?.resetPage" @search="searchList"></m-header>
        <a-list-layout ref="layout" :params="queryParams" #default="data" request_url="/task/taskList">
            <m-list-team v-for="(item, index) in data.lists" :item="item" :index="index" :key="data.id"></m-list-team>
        </a-list-layout>
    </view>
    <m-update-app></m-update-app>
    <a-tabbar path="pages/tabbar/index"></a-tabbar>
</template>
<script setup>
import { ref, reactive, nextTick, watch } from 'vue';
import { debounce } from 'lodash';
import { onLoad, onShow, onPullDownRefresh } from '@dcloudio/uni-app';
// import { getSignInfo } from "@/uni_modules/XF-appSignUTS"
// getSignInfo({
//   complete: (res) => {
//         console.log(res)
//   }
// });

const state = reactive({
    messageNum: 0,
    notice_list: [],
    index_info: {
        banner: [],
        banner2: [],
        type: []
    }
});
const show_city = ref(false);
const layout = ref(null);
const queryParams = reactive({
    search: ''
});
const searchList = debounce(
    (e) => {
        queryParams.search = e;
        layout.value.resetPage();
    },
    500,
    {
        leading: false
    }
);
//切换地址触发事件
watch(
    [() => uni.$store('data').studentList],
    ([n]) => {
        if (n) {
            nextTick(() => layout.value.resetPage());
        }
    },
    {
        flush: 'post'
    }
);

onPullDownRefresh(() => {
    nextTick(() => layout.value.resetPage());
    setTimeout(() => uni.stopPullDownRefresh(), 500);
});
onShow(() => {});
onLoad(async (options) => {
    nextTick(() => layout.value.getLists());
});
</script>
<style scoped lang="scss">
.u-notice-bar {
    width: 720rpx;
    margin: 20rpx auto 0;
}
</style>
